﻿#ifndef _FITKABSTRACT_SEA_SUBSYS_NODES_H___
#define _FITKABSTRACT_SEA_SUBSYS_NODES_H___
 
#include "FITKAbstractSEASubSys.h"

namespace Acoustics
{
    class FITKAbstractSEAFace;
    /**
     * @brief 需要点集合的子系统抽象类，梁 板等
     * @author LiBaojun (libaojunqd@foxmail.com)
     * @date 2024-10-06
     */
    class FITKAcousticsModelAPI FITKAbstractSEASubSysWithNodes : public FITKAbstractSEASubSys
    {
        Q_OBJECT
    public:
        /**
         * @brief SEA子系统节点类型
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-15
         */
        enum SubSysNodeType
        {
            None,          ///< 空
            Start,         ///< 起点
            Path,          ///< 路径上的点 (中间点)
            Corner,        ///< 拐点
            Finish,        ///< 终点
        };
        Q_ENUM(SubSysNodeType);

        /**
         * @brief 子系统节点
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-15
         */
        struct SubSysNode
        {
            int _id{ -1 };              // 节点ID
            SubSysNodeType _type{ None }; // 节点类型 
        };


    public:
        /**
         * @brief Construct a new FITKAbstractSEASubSys object
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-06
         */
        explicit FITKAbstractSEASubSysWithNodes() = default;
        /**
         * @brief Destroy the FITKAbstractSEASubSys object
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-06
         */
        virtual ~FITKAbstractSEASubSysWithNodes() = 0;
        /**
         * @brief 设置ID链表
         * @param[i]  nodes            节点列表
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-06
         */
        virtual void setNodes(const QList<SubSysNode>& nodes);
        /**
         * @brief 获取节点列表
         * @return QList<SubSysNode>
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-06
         */
        QList<SubSysNode> getNodes();
        /**
         * @brief 获取节点ID列表
         * @return QList<int>
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-06
         */
        QList<int> getNodeIDs() const override;
        /**
         * @brief 设置基础对象ID
         * @param[i]  pid            板基础对象ID
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-11-07
         */
        void setFaceID(const int & pid);
        /**
         * @brief 获取基础对象ID
         * @return int
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-11-07
         */
        int getFaceID() const;
        /**
         * @brief 获取基础对象
         * @return FITKAbstractSEAFace*
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-11-07
         */
        FITKAbstractSEAFace* getFaceObj()const ;
        /**
         * @brief    更新几何属性
         * @return   bool
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-11-19
         */
        virtual bool updateGeoProp() override;

        /**
        * @brief 是否包含点
        * @param[i] id 节点ID
        * @return bool
        * @author LiBaojun (libaojunqd@foxmail.com)
        * @date 2024-11-14
        */
        bool isContainsNode(const int id) const override;

    protected:
        /**
         * @brief 基础面对象ID
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-11-07
         */
        int _faceID{ -1 };

    };
}


#endif
